﻿@model eShop.Web.Models.ShipAddressListModel
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>收货地址-@{@WorkContext.ShopConfig.SiteTitle}</title>
    @Html.Raw(WorkContext.ShopConfig.SEOKeyword)
    @Html.Raw(WorkContext.ShopConfig.SEODescription)
    <link href="@{@WorkContext.CSSCDN}/themes/default/css/base.css" rel="stylesheet" type="text/css" />
    <link href="@{@WorkContext.CSSCDN}/themes/default/css/ucenter.css" rel="stylesheet" type="text/css" />
    <script src="@{@WorkContext.ScriptCDN}/scripts/jquery.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/region.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/common.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/ucenter.user.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid = @WorkContext.Uid;
        isGuestSC = @WorkContext.ShopConfig.IsGuestSC;
        scSubmitType = @WorkContext.ShopConfig.SCSubmitType;
    </script>
</head>

<body>
@Html.Partial("_header")

<div class="bigBox" id="member">
<div class="box">
@Html.Partial("_menu")
<div id="memberR">
<div class="SHtitle"><a href="javascript:openAddShipAddressBlock()" class="greenBT">新增收获地址</a> &nbsp; 您已创建<b>@Model.ShipAddressCount</b> 个收货地址，最多可创建<b>@WorkContext.ShopConfig.MaxShipAddress</b>个</div>

    @foreach (FullShipAddressInfo info in Model.ShipAddressList)
    {
    <div class="SHadress" id="shipAddress@{@info.SAId}">
        <h4>@info.Alias<div class="SHedit">
            @if (info.IsDefault == 0)
            {
            <a href="javascript:void(0)" onclick="setDefaultShipAddress(@info.SAId,this)" id="" class="grayBT">设为默认</a>
            }
            else
            {
            <a href="javascript:void(0)" onclick="setDefaultShipAddress(@info.SAId,this)" id="defaultShipAddress" style=" display:none;" class="grayBT">设为默认</a>
            }
            <a href="javascript:void(0)" onclick="openEditShipAddressBlock(@info.SAId)" class="grayBT">编辑</a>&nbsp;
            <a href="javascript:void(0)" onclick="delShipAddress(@info.SAId)" class="grayBT">删除</a>
        </div></h4>
        <ul>
            <li><b>收货人：</b><em>@info.Consignee</em><div class="clear"></div></li>
            <li><b>所在地区：</b><em>@info.ProvinceName@info.CityName@info.CountyName</em><div class="clear"></div></li>
            <li><b>地址：</b><em>@info.Address</em><div class="clear"></div></li>
            <li><b>手机：</b><em>@info.Mobile</em><div class="clear"></div></li>
            <li><b>固定电话：</b><em>@info.Phone</em><div class="clear"></div></li>
            <li><b>电子邮箱：</b><em>@info.Email</em><div class="clear"></div></li>
        </ul>
    </div>
    }

<div id="shipAddressBlock" style=" display:none;">
    <form name="shipAddressForm" action="">
        <input type="hidden" name="saId" value=""/> 
        <div class="SHtable">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr><th><em>*</em>别名：</th></tr>
          <tr><td><input type="text" name="alias" value="" class="text" maxlength="15" style="width:200px" /></td></tr>

          <tr><th><em>*</em>收货人：</th></tr>
          <tr><td><input type="text" name="consignee" value="" class="text" maxlength="15" style="width:200px" /></td></tr>

          <tr><th><em>*</em>所在地区：</th></tr>
          <tr>
            <td>
                <select id="provinceId" name="provinceId">
                <option selected="selected" value="-1">请选择</option>
                </select>
                <select id="cityId" name="cityId">
                <option selected="selected" value="-1">请选择</option>
                </select>
                <select id="regionId" name="regionId">
                <option selected="selected" value="-1">请选择</option>
                </select>
            </td>
          </tr>
  
          <tr><th><em>*</em>详细地址：</th></tr>
          <tr><td><input type="text" name="address" value="" class="text" style="width:480px" /></td></tr>

          <tr><th><em>*</em>手机号：</th></tr>
          <tr><td><input type="text" name="mobile" value="" class="text" maxlength="15" style="width:200px" />&nbsp;&nbsp;或固定电话<input type="text" name="phone" value="" class="text" maxlength="15" style="width:200px" /></td></tr>

          <tr><th>电子邮箱：</th></tr>
          <tr><td><input type="text" name="email" value="" class="text" maxlength="15" style="width:200px" /></td></tr>

          <tr><th>邮政编码：</th></tr>
          <tr><td><input type="text" name="zipcode" value="" class="text" maxlength="15" style="width:200px" /></td></tr>

          <tr><th>默认地址：</th></tr>
          <tr><td><input type="checkbox" name="isDefault" checked="checked"/></td></tr>
  
          <tr>
            <td height="80">
            <a href="javascript:addShipAddress()" id="addShipAddressBut" style=" display:none;" class="greenBT" style=" padding:3px 20px;font-size:16px;">新增</a>
            <a href="javascript:editShipAddress()" id="editShipAddressBut" style=" display:none;" class="greenBT" style=" padding:3px 20px;font-size:16px;">编辑</a>
            </td>
          </tr>
        </table>
        </div>
    </form>
    <script type="text/javascript">
        //绑定省列表的改变事件
        $("#provinceId").change(function(){
            var selectedProvinceId = $(this).find("option:selected").val();
            if (selectedProvinceId > 0) {
                $("#regionId").html("<option value='-1'>请选择</option>");
                bindCityList(selectedProvinceId, document.getElementById("cityId"));
            }
        })

        //绑定市列表的改变事件
        $("#cityId").change(function(){
            var selectedCityId = $(this).find("option:selected").val();
            if (selectedCityId > 0) {
                bindCityList(selectedCityId, document.getElementById("regionId"));
            }
        })

        //绑定省列表
        bindProvinceList(document.getElementById("provinceId"), provinceId);

        if (cityId > 0) {
            bindCityList(provinceId, document.getElementById("cityId"), cityId);
            bindCountyList(cityId, document.getElementById("regionId"), countyId);
        }
</script>
</div>

 </div>

<div class="clear"></div>
</div>
<div class="clear"></div>
</div>


@Html.Partial("_footer")
</body>
</html>
